package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.api.model.vo.FrontGoodsVo;
import com.weixing.mall.provider.model.domain.ActivityGoods;
import com.weixing.mall.provider.model.query.act.ActGoodsQuery;
import com.weixing.mall.provider.model.vo.act.ActivityGoodsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 促销模块-活动商品表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-16
 */
public interface ActivityGoodsMapper extends BaseMapper<ActivityGoods> {

    ActivityGoods findByActIdAndProductSn(Long id, String productSn);

    IPage<ActivityGoodsVo> findList(@Param("pg") Page page,@Param("qs") ActGoodsQuery query);

    Long findListTotalNum(@Param("qs") ActGoodsQuery query);

    IPage agentGoods(@Param("pg") Page initMpPage);

    IPage agentFrontGoods(@Param("pg") Page initMpPage);

    List<FrontGoodsVo> agentGoods();

    List<FrontGoodsVo> agentFrontGoods();

    List<ActivityGoods> findByActId(Long actId);

    void  upOrDown(@Param("array")long []ids,@Param("flag")int flag);

    ActivityGoods findByActIdAndItemId(@Param("actId") Long actId, @Param("itemId")Long itemId);

    List<ActivityGoodsVo> findList(@Param("qs") ActGoodsQuery query);
}
